Skip to content

fix(projects): add Delete Project option to context menu with confirm…#2175

Open
mewzherder wants to merge 2 commits into
helixml:mainfrom
mewzherder:fix/2172-delete-project-menu
Open

fix(projects): add Delete Project option to context menu with confirm…#2175
mewzherder wants to merge 2 commits into
helixml:mainfrom
mewzherder:fix/2172-delete-project-menu

Conversation

@mewzherder
Copy link
Copy Markdown
Contributor

Fixes #2172

Problem

Users had no discoverable way to delete a project from the Projects page. The 3-dot menu on project cards only showed "Settings", and the delete option was buried inside the Settings page under the "Danger Zone" tab.

Solution

Added a "Delete Project" menu item (styled in error/red color) to the project card 3-dot context menu. Clicking it opens a confirmation dialog before performing the deletion.

Changes

  • Added DeleteForeverIcon, Dialog, DialogTitle, DialogContent, DialogContentText, DialogActions imports
    • Added useDeleteProject import from services
    • Added deleteConfirmOpen and projectToDelete state variables
    • Added handleDeleteProjectMenu handler: saves selected project, opens confirm dialog, closes context menu
    • Added handleConfirmDelete handler: calls deleteProjectMutation.mutateAsync, shows success/error snackbar, invalidates project list query
    • Added red-styled "Delete Project" MenuItem to the context menu (after Settings)
    • Added confirmation Dialog with title "Delete Project", body "Are you sure you want to delete {name}? This action cannot be undone.", and Cancel/Delete buttons

Testing

  1. Open the Projects page
    1. Click the 3-dot menu on any project card
    1. Verify "Delete Project" appears below "Settings" in red
    1. Click "Delete Project" — confirm the dialog appears with the correct project name
    1. Click Delete — confirm the project is removed and a success snackbar appears
    1. Click Cancel — confirm the dialog closes and the project is not deleted

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Projects page: I don't see a way to delete an existing project

1 participant